package com.marquis.cloud.fallBack;

import com.marquis.cloud.client.AutUserClient;
import com.marquis.cloud.entity.AutUser;
import com.marquis.cloud.pagequery.PaginationGrid;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 熔断器FallBack
 */
@Component
public class AutUserFallBack implements AutUserClient {


    @Override
    public PaginationGrid<AutUser> queryUserPage(Integer page, Integer pageSize) {
        PaginationGrid<AutUser> paginationGrid = new PaginationGrid<>();
        List<AutUser> list = new ArrayList<>();
        AutUser user = new AutUser();
        user.setUserId(1L);
        user.setUserName("失败");
        user.setPassword("AutUserFallBack");
        list.add(user);
        paginationGrid.setTotal(0L);
        paginationGrid.setRows(list);
        return paginationGrid;
    }

    @Override
    public AutUser findByUserName(String userName) {
        return new AutUser();
    }
}
